package com.zufe.ListTest;

import java.util.ArrayList;

public class TeacherTest {
    public static void main(String[] args) {
        ArrayList<Teacher> teacherList = new ArrayList<Teacher>();
        Teacher teacher1 = new Teacher("张三", "javaee");
        Teacher teacher2 = new Teacher("李四", "javaee");
        Teacher teacher3 = new Teacher("王五", "php");
        Teacher teacher4 = new Teacher("赵六", "python");
        teacherList.add(teacher1);
        teacherList.add(teacher2);
        teacherList.add(teacher3);
        teacherList.add(teacher4);
        for (int i = 0; i < teacherList.size(); i++) {
            System.out.println("姓名：" + teacherList.get(i).getName() + "，专业：" + teacherList.get(i).getProfession());
        }
    }
}
